<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: FIR functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__hppass__sar__fir.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">FIR functions<div class="ingroups"><a class="el" href="group__group__hppass.html">HPPASS       (High Performance Programmable Analog Sub-System)</a> &raquo; <a class="el" href="group__group__hppass__sar.html">SAR (Successive-Approximation Register Analogue to Digital Converter)</a> &raquo; <a class="el" href="group__group__hppass__sar__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac9ea183de95791dd5833e66b4120cd70"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__hppass__enums.html#ga14c32a49b351302efcaf56b2e5075e00">cy_en_hppass_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hppass__sar__fir.html#gac9ea183de95791dd5833e66b4120cd70">Cy_HPPASS_SAR_FirConfig</a> (uint8_t firIdx, const <a class="el" href="structcy__stc__hppass__fir__t.html">cy_stc_hppass_fir_t</a> *firCfg)</td></tr>
<tr class="memdesc:gac9ea183de95791dd5833e66b4120cd70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the ADC FIR filter.  <a href="#gac9ea183de95791dd5833e66b4120cd70">More...</a><br /></td></tr>
<tr class="separator:gac9ea183de95791dd5833e66b4120cd70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga62db7a1560b11191a6773929cf0d3ef5"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hppass__sar__fir.html#ga62db7a1560b11191a6773929cf0d3ef5">Cy_HPPASS_SAR_Result_FirRead</a> (uint8_t firIdx)</td></tr>
<tr class="memdesc:ga62db7a1560b11191a6773929cf0d3ef5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the the ADC FIR filter result.  <a href="#ga62db7a1560b11191a6773929cf0d3ef5">More...</a><br /></td></tr>
<tr class="separator:ga62db7a1560b11191a6773929cf0d3ef5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gac9ea183de95791dd5833e66b4120cd70"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac9ea183de95791dd5833e66b4120cd70">&#9670;&nbsp;</a></span>Cy_HPPASS_SAR_FirConfig()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__hppass__enums.html#ga14c32a49b351302efcaf56b2e5075e00">cy_en_hppass_status_t</a> Cy_HPPASS_SAR_FirConfig </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>firIdx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__hppass__fir__t.html">cy_stc_hppass_fir_t</a> *&#160;</td>
          <td class="paramname"><em>firCfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the ADC FIR filter. </p>
<dl class="section note"><dt>Note</dt><dd>If AC is running this configuration is not allowed (<a class="el" href="group__group__hppass__enums.html#gga14c32a49b351302efcaf56b2e5075e00a7f6c5e025421582710cadfffcada200c">CY_HPPASS_AC_INVALID_STATE</a> will be returned).</dd>
<dd>
If the SAR block is currently busy the initialization is not allowed (<a class="el" href="group__group__hppass__enums.html#gga14c32a49b351302efcaf56b2e5075e00a1b8592bb519e24c005a10ee1d49a8c58">CY_HPPASS_SAR_INVALID_STATE</a> will be returned).</dd>
<dd>
Since the 'block ready' status is combined SAR and CSG, this particular SAR function cannot be protected from reinitialization during the 'block ready' == true condition, so it is on user's responsibility when and from where to call this function to reconfigure this SAR sub-block.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">firIdx</td><td>The index of the FIR filter instance. Valid range 0..1.</td></tr>
    <tr><td class="paramname">firCfg</td><td>Pointer to the FIR filter configuration structure <a class="el" href="structcy__stc__hppass__fir__t.html">cy_stc_hppass_fir_t</a>. The pointer cannot be NULL.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status, <a class="el" href="group__group__hppass__enums.html#ga14c32a49b351302efcaf56b2e5075e00">cy_en_hppass_status_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line"><span class="keyword">const</span> <a class="code" href="structcy__stc__hppass__fir__t.html">cy_stc_hppass_fir_t</a> firCfg =</div><div class="line">{</div><div class="line">    .<a class="code" href="structcy__stc__hppass__fir__t.html#ab20bac84d6c2144e7189cc92f815f7ca">chan</a>     = <a class="code" href="group__group__hppass__sar__enums.html#gga075c21d159c50ff7bb21b992f1a397b7a8a3672c5ef783bd4cd09b9ae10347641">CY_HPPASS_FIR_CHAN_0</a>,            <span class="comment">/* Use FIR channel #0 */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Do not wait for 16 samples before the output is stored into a FIR_RESULT register */</span></div><div class="line">    .waitTapInit = <span class="keyword">false</span>,</div><div class="line"></div><div class="line">    <span class="comment">/* Test filter coeficients. Need to be updated, if particular filter type is needed. */</span></div><div class="line">    .coef        = {0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000},</div><div class="line">    .limit    = <a class="code" href="group__group__hppass__sar__enums.html#gga761a8378e0f3b0eab1a27f8617d1c02eae8979b0849935acf47a6057472a8c377">CY_HPPASS_SAR_LIMIT_DISABLED</a>,    <span class="comment">/* Limits are disabled */</span></div><div class="line">    .result      = <span class="keyword">true</span>,                            <span class="comment">/* FIR result is exposed to read */</span></div><div class="line">    .fifo     = <a class="code" href="group__group__hppass__sar__enums.html#ggaf90fa2a37e0fb7ef39e80b0c8c3179e9a96c195407d9b1b7ae8f51e56daf4eab6">CY_HPPASS_FIFO_0</a>                 <span class="comment">/* Use FIFO#0 */</span></div><div class="line">};</div></div><!-- fragment --><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Configure FIR#0 */</span></div><div class="line">    status = <a class="code" href="group__group__hppass__sar__fir.html#gac9ea183de95791dd5833e66b4120cd70">Cy_HPPASS_SAR_FirConfig</a>(0U, &amp;firCfg);</div><div class="line">    <span class="comment">/* Process returned status */</span></div></div><!-- fragment -->
</div>
</div>
<a id="ga62db7a1560b11191a6773929cf0d3ef5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga62db7a1560b11191a6773929cf0d3ef5">&#9670;&nbsp;</a></span>Cy_HPPASS_SAR_Result_FirRead()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE int16_t Cy_HPPASS_SAR_Result_FirRead </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>firIdx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the the ADC FIR filter result. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">firIdx</td><td>The index of the FIR filter instance. Valid range 0..1.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>FIR filter result</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Read filtered result from FIR#1 */</span></div><div class="line">    int16_t firResult = <a class="code" href="group__group__hppass__sar__fir.html#ga62db7a1560b11191a6773929cf0d3ef5">Cy_HPPASS_SAR_Result_FirRead</a>(1U);</div><div class="line">    <span class="comment">/* Process returned firResult */</span></div></div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
